﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
/// <summary>
/// 该类用于获取当前服务器名称以及网站的虚拟路径
/// </summary>
public class GetUrlPath
{
    public GetUrlPath()
    {
    }
    /// <summary>
    /// 该属性返回当前网站的“主机名+虚拟路径”
    /// </summary>
    /// <returns>返回一个以“主机名+虚拟路径”为内容的字符串</returns>
    public static string GetUrl
    {
        get
        {
            return @"http://" + HttpContext.Current.Request.Url.Host + HttpContext.Current.Request.ApplicationPath;
        }
    }
}